package com.hfzy.ihk.web.userCenter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hfzy.ihk.facade.userCenter.entity.UserHasResource;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wws
 * @since 2018-12-28
 */
public interface UserHasResourceMapper extends BaseMapper<UserHasResource> {

    int saveUserHasResource(@Param("userId") Long userId, @Param("resourceIds") List<Long> resourceIds);


    @Select("delete from user_has_resource where user_id = #{userId}")
    void deleteUserHasResourceByUserId(Long userId);

    @Select("select resource_id from user_has_resource where user_id = #{id}")
    List<Integer> queryRrsourceByUserId(Long id);
}
